//
//  JHSSetOrHelpCell.m
//  设置与帮助
//
//  Created by 卢春晖 on 2017/3/22.
//  Copyright © 2017年 itheima. All rights reserved.
//

#import "JHSSetOrHelpCell.h"


@implementation JHSSetOrHelpCell{
    NSDictionary *_dic;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupUI];
    }
    return self;
}
-(void)setRow:(NSInteger)row{
    
    switch (row) {
        case 0:
        {
            
            _dic =@{@"name":@"意见反馈",@"icon":@"意见反馈"};
            break;}
        case 1:
        {
            _dic =@{@"name":@"加符号说明",@"icon":@"加符号说明"};
            break;}
        case 2:
        {
           _dic =@{@"name":@"修改密码",@"icon":@"修改密码"};
            break;
        }
        case 3:
        {
           _dic =@{@"name":@"清除缓存",@"icon":@"清除缓存"};
            break;
        }
        case 4:
        {
           _dic =@{@"name":@"注销",@"icon":@"注销set"};
            break;
        }
        default:
            break;
    }
    
}
-(void)setupUI{

    
    UIImageView *imgV = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"IfTreatment"]];
    [self.imageView sizeToFit];
    [self.contentView addSubview:imgV];
    
    [imgV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(10);
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.size.mas_offset(CGSizeMake(30, 30));
    }];
    
    
    
    UILabel *textLabel = [[UILabel alloc]init];
    textLabel.text = _dic[@"name"];
    [self.contentView addSubview:textLabel];
    [textLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(imgV.mas_right).offset(10);
        make.centerY.equalTo(self.contentView.mas_centerY);
    }];
    
    UIImageView *img = [[UIImageView alloc]initWithImage:[UIImage imageNamed:_dic[@"icon"]]];
    [self.contentView addSubview:img];
    [img sizeToFit];
    [img mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView.mas_right).offset(10);
        make.centerY.equalTo(self.mas_centerY);
    }];
    
}

@end
